<?php

namespace mpend\modules\demand\controllers;

use Yii;
use mpend\components\Controller;
use mpend\modules\demand\models\CategorySearch;

/**
 * 栏目分类需求
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class CategoryController extends Controller {

    /**
     * @inheritdoc
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    /**
     * 栏目列表
     * {@inheritdoc}
     */
    public function actionIndex() {
        $model = new CategorySearch();
        return $model->search(Yii::$app->request->getQueryParams());
    }

    /**
     * 栏目配置
     * {@inheritdoc}
     */
    public function actionOptions() {
        return CategorySearch::getOptionsList();
    }

}
